using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using G15_Agent.Models.Mapping;

namespace G15_Agent.Models
{
    public class AgentContext : DbContext
    {
        static AgentContext()
        {
            Database.SetInitializer<AgentContext>(null);
        }

		public AgentContext()
			: base("Name=AgentContext")
		{
		}

        public DbSet<ChiTietHDKH> ChiTietHDKHs { get; set; }
        public DbSet<DanhSachNCC> DanhSachNCCs { get; set; }
        public DbSet<HoaDonKH> HoaDonKHs { get; set; }
        public DbSet<HoaDonNCC> HoaDonNCCs { get; set; }
        public DbSet<LoaiNCC> LoaiNCCs { get; set; }
        public DbSet<NguoiDung> NguoiDungs { get; set; }
        public DbSet<TheTinDung> TheTinDungs { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Configurations.Add(new ChiTietHDKHMap());
            modelBuilder.Configurations.Add(new DanhSachNCCMap());
            modelBuilder.Configurations.Add(new HoaDonKHMap());
            modelBuilder.Configurations.Add(new HoaDonNCCMap());
            modelBuilder.Configurations.Add(new LoaiNCCMap());
            modelBuilder.Configurations.Add(new NguoiDungMap());
            modelBuilder.Configurations.Add(new TheTinDungMap());
        }
    }
}
